<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>首页-全部</title>
		<link rel="stylesheet" type="text/css" href="css/home_all.css" />
		<script type="text/javascript" src="js/rem.js"></script>
		<style type="text/css">
			[v-cloak] {
				display: none;
			}
		</style>
	</head>

	<body>
		<div id="app" v-cloak class="homeallBox">
			<div class="homeall_left">
				<div @click="listsTap(index)" v-for="(item,index) in lists" :class="[classIndex==index?'hli_cheak':'']" class="homeall_left_inner">{{item.list}}</div>
			</div>
			
			<div class="homeall_right">
				<template v-for="(item,index) in lists"> 
					<div v-if="classIndex==index" v-for="right in item.rights" class="homeall_right_inner">
						<div class="homeall_right_inner_title">
							<div class="hrit_left">
								<img :src="right.img" />
								<div>{{right.name}}</div>
							</div>
							<a href="home_food.html" class="hrit_right">
								<span>全部</span>
								<img src="images/right.png" />
							</a>
						</div>
						<div class="homeall_right_inner_content">
							<div @click="tolist" v-for="inner in right.inners" class="hric_inner">{{inner}}</div>
						</div>
					</div>
				</template>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="js/vue2.5.16.js"></script>
	<script type="text/javascript">
		
		var app = new Vue({
			el:"#app",
			data:{
				classIndex:0,
				lists:[
					{
						list:'美食',
						rights:[
							{
								img:'images/z_food.png',
								name:'美食',
								inners:['快餐小吃','快餐小吃','快餐小吃','快餐小吃','快餐小吃','快餐小吃']
							}
						]
						
					},
					{
						list:'超市',
						rights:[
							{
								img:'images/z_car.png',
								name:'超市',
								inners:['瓜子饮料','瓜子饮料','瓜子饮料','瓜子饮料','瓜子饮料','瓜子饮料']
							}
						]
					},
					{
						list:'休闲娱乐',
						rights:[
							{
								img:'images/z_play.png',
								name:'休闲娱乐',
								inners:['打球K歌','打球K歌','打球K歌','打球K歌','打球K歌','打球K歌']
							}
						]
					}
				]
			},
			methods:{
				//左侧
				listsTap:function(index){
					this.classIndex = index;
				},
				
				tolist:function(){
					window.location.href = 'home_food.html'
				}
				
			}
		})
		
		
		
	</script>
</html>